package com.deyuanyun.pic.ae.controller.vo;

import com.deyuanyun.pic.ae.domain.PopulationDistribution;
import com.deyuanyun.pic.ae.domain.PressObject;
import com.deyuanyun.pic.common.util.NumberUtil;
import com.deyuanyun.pic.common.util.StringUtils;
import com.deyuanyun.pic.pipe.controller.vo.BaseVOUtil;
import com.deyuanyun.pic.pipe.util.PipeMgrUtil;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;
import com.deyuanyun.pic.settings.support.biz.PipeLineUtil;
import com.github.pagehelper.Page;

import java.util.Date;

/**
 * E_8管道沿线人口分布信息表
 */
public class PopulationDistributionVO extends AEBaseVO<PopulationDistribution> {

    // 管道名称
    private String pipeLineName;
    // 起点桩号
    private String beginPile;
    // 终点桩号
    private String endPile;
    // 省
    private String province;
    // 市
    private String city;
    // 区（县）
    private String district;
    // 镇（乡）
    private String town;
    // 村（街道）
    private String village;
    // 常住人口数量
    private Long population;
    // 联系人
    private String contact;
    // 联系人职务
    private String contactPosition;
    // 联系方式
    private String telephone;

    // 数据状态
    private String dataStated;
    private String gisid;

    public String getPipeLineName() {
        return pipeLineName;
    }

    public void setPipeLineName(String pipeLineName) {
        this.pipeLineName = pipeLineName;
    }

    public String getBeginPile() {
        return beginPile;
    }

    public void setBeginPile(String beginPile) {
        this.beginPile = beginPile;
    }

    public String getEndPile() {
        return endPile;
    }

    public void setEndPile(String endPile) {
        this.endPile = endPile;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getTown() {
        return town;
    }

    public void setTown(String town) {
        this.town = town;
    }

    public String getVillage() {
        return village;
    }

    public void setVillage(String village) {
        this.village = village;
    }

    public Long getPopulation() {
        return population;
    }

    public void setPopulation(Long population) {
        this.population = population;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getContactPosition() {
        return contactPosition;
    }

    public void setContactPosition(String contactPosition) {
        this.contactPosition = contactPosition;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getDataStated() {
        return dataStated;
    }

    public void setDataStated(String dataStated) {
        this.dataStated = dataStated;
    }

    public String getGisid() {
        return gisid;
    }

    public void setGisid(String gisid) {
        this.gisid = gisid;
    }

    @Override
    public void fromDomain(PopulationDistribution domain) {

        // 管道名称
        this.pipeLineName = PipeLineUtil.getPipeLineName(domain.getPipeLineId());
        // 起点桩号
        this.beginPile = PipeMgrUtil.getIdentificationNumber(domain.getBeginPile());
        // 终点桩号
        this.endPile = PipeMgrUtil.getIdentificationNumber(domain.getEndPile());
        // 省
        this.province = domain.getProvince();
        // 市
        this.city = domain.getCity();
        // 区（县）
        this.district = domain.getDistrict();
        // 镇（乡）
        this.town = domain.getTown();
        // 村（街道）
        this.village = domain.getVillage();
        // 常住人口数量
        this.population = domain.getPopulation();
        // 联系人
        this.contact = domain.getContact();
        // 联系人职务
        this.contactPosition = domain.getContactPosition();
        // 联系方式
        this.telephone = domain.getTelephone();

        // 数据状态
        this.dataStated = domain.getDataStated();
        this.gisid = domain.getGisid();

        super.fromDomain(domain.getId(), domain.getRecorder(), domain.getRecordTime(), domain.getRemarks());
    }

    public Page<PopulationDistributionVO> fromDomainList(Page<PopulationDistribution> domainList) {
        Page<PopulationDistributionVO> list = new Page<PopulationDistributionVO>();
        for (PopulationDistribution populationDistribution : domainList) {
            PopulationDistributionVO populationDistributionVO = new PopulationDistributionVO();
            populationDistributionVO.fromDomain(populationDistribution);
            list.add(populationDistributionVO);
        }
        BaseVOUtil.converterPage(domainList, list);
        return list;
    }
}